package com.tdu.sp1;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/*
 * 这个类用来测试spring1
 *
 */
public class test_spring1 {
    public static void main(String[] args) {
        /*
         * 1 spring创建对象，放进ioc容器
         * 2 从ioc 容器中获取对象
         * 3 调用eat方法测试
         */
        ApplicationContext context = new AnnotationConfigApplicationContext("com.tdu.sp1");
        spring1 eat = context.getBean(spring1.class);
        eat.eat();
    }
}
